import { defAxios as request } from '@/utils/http'

/**
 * 航道代码
 * @returns
 */
export const getRoadInformation = data => request({
  url: '/channel/getList',
  method: 'GET',
  data
})

/**
 * 航道代码 - 分页
 * @returns
 */
export const getRoadIndex = params => request({
  url: '/channel/index',
  method: 'GET',
  params
})

/**
 * 新增公路
 * @param {*} params
 * @returns
 */
export const roadAdd = data => request({
  url: '/channel/add',
  method: 'POST',
  data
})

/**
 * 删除公路
 * @param {*} params
 * @returns
 */
export const roadDel = params => request({
  url: `/channel/delete/${params}`,
  method: 'DELETE'
})

/**
 * 编辑公路
 * @param {*} params
 * @returns
 */
export const roadEdit = data => request({
  url: '/channel/edit',
  method: 'PUT',
  data
})
/**
 * 根据登录用户获取公路列表
 * @returns
 */
export const getRoadListByUser = data => request({
  url: '/leg/listByUserType',
  method: 'GET',
  data
})

/**
 * 根据登录用户获取公路列表2
 * @returns
 */
export const getChannelListByUser = data => request({
  url: '/channel/list/by/dept/userType',
  method: 'GET',
  data
})

/**
 * 编辑航段
 * @param {*} params
 * @returns
 */
// export const queryCityList = () => request({
//   url: '/city/queryCityList',
//   method: 'GET'
// })
